<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditMaterialTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditMaterialLabel_id}" for="id" />
                    <h:inputText id="id" value="#{materialController.selected.id}" title="#{bundle.EditMaterialTitle_id}" required="true" requiredMessage="#{bundle.EditMaterialRequiredMessage_id}"/>
                    <h:outputLabel value="#{bundle.EditMaterialLabel_descricao}" for="descricao" />
                    <h:inputText id="descricao" value="#{materialController.selected.descricao}" title="#{bundle.EditMaterialTitle_descricao}" />
                    <h:outputLabel value="#{bundle.EditMaterialLabel_tempoDecomposicao}" for="tempoDecomposicao" />
                    <h:inputText id="tempoDecomposicao" value="#{materialController.selected.tempoDecomposicao}" title="#{bundle.EditMaterialTitle_tempoDecomposicao}" />
                    <h:outputLabel value="#{bundle.EditMaterialLabel_toxico}" for="toxico" />
                    <h:inputText id="toxico" value="#{materialController.selected.toxico}" title="#{bundle.EditMaterialTitle_toxico}" />
                    <h:outputLabel value="#{bundle.EditMaterialLabel_tipo}" for="tipo" />
                    <h:inputText id="tipo" value="#{materialController.selected.tipo}" title="#{bundle.EditMaterialTitle_tipo}" />
                    <h:outputLabel value="#{bundle.EditMaterialLabel_observacoes}" for="observacoes" />
                    <h:inputTextarea rows="4" cols="30" id="observacoes" value="#{materialController.selected.observacoes}" title="#{bundle.EditMaterialTitle_observacoes}" />
                </h:panelGrid>
                <h:commandLink action="#{materialController.update}" value="#{bundle.EditMaterialSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditMaterialViewLink}"/>
                <br />
                <h:commandLink action="#{materialController.prepareList}" value="#{bundle.EditMaterialShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditMaterialIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
